#!/bin/sh

which qmake >/dev/null 2>&1
if [ $? -ne 0 ]; then
  which qmake-qt4 >/dev/null 2>&1
  if [ $? -ne 0 ]; then
    echo "Please install qmake."
    exit 1
  fi
  qmake-qt4
else
  qmake
fi

if [ $? -eq 0 ]; then
  make
else
  echo "qmake error!"
  exit 1
fi
